<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>

<div id="app">
    <div> {{info.bookName}} </div>
    <div> {{info.address.city}} </div>
    <a v-bind:href="info.url"></a>
</div>


<script>
    var vm = new Vue({//
        el: "#app",
        data: {},
        data() {
            return {
                //请求的返回参数合适，必须和json字符串一致
                info:{
                    bookName: null,
                    address:{
                        province:null,
                        city:null,
                        country:null
                    },
                    url:null
                }
            }
        },
        mounted() {//钩子函数，链式编程
            axios.get('test1.json').then(response=>(this.info=response.data));
        },
       
    })
</script>


</body>
</html>